#!/bin/bash -e

function info() {
echo Usage: `basename $0` snp.vcf indel.vcf
exit 65
}

while getopts  ":i:p:G" opts
do
        case  $opts  in
        i) intervals=$OPTARG;;
		p) out_prefix=$OPTARG;;
		G) somatic=true;;
		*) info;;
        esac
done
shift $(($OPTIND - 1))

if test -z "$1"; then info; fi


. $var

filter_clustered_mutations.pl $1 $2 

format_filter_vcf.pl $1.cluster_drop.vcf nprot_cluster "nprot_cluster filter" > $1.nprot.low.vcf

format_filter_vcf.pl $2.cluster_drop.vcf nprot_cluster "nprot_cluster filter" > $2.nprot.low.vcf

combine_vcfs.sh -p$out_prefix $1.cluster_filtered.vcf $1.nprot.low.vcf $2.cluster_filtered.vcf $2.nprot.low.vcf 

mv $out_prefix.combine.vcf $out_prefix.nprot.filter.vcf && mv $out_prefix.combine.vcf.idx $out_prefix.nprot.filter.vcf.idx

. $cmd_done